import os

def login(username : str, password : str) -> tuple[int, str]:
    if os.path.exists(os.path.join("userInfo", f"{username}.txt")):
        with open(os.path.join("userInfo", f"{username}.txt"), "r", encoding="utf-8") as f:
            content = f.read()
            if password in content:
                return "success", "登录成功"
            else:
                return "error", "密码错误"
    else:
        return "error", "不存在此用户"